// $_FILEHEADER_BEGIN ***************************
// 版权声明:Timer
// Copyright © 2015 - Timer All Rights Reserved
// 文件名称: ARTitleCell.m
// 创建日期: 15/12/13
// 创 建 人: 甄鑫
// 文件说明: <#content#>
// $_FILEHEADER_END ******************************


#import "ARTitleCell.h"
#import "ARViewHepler.h"

@implementation ARTitleCell
{
    ARCellModel * _cellModel;
}
- (void)awakeFromNib {
    // Initialization code
    [self uiConfig];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.statuImage.layer.cornerRadius = self.statuImage.frame.size.width/2.0;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)uiConfig
{
}

- (void)setData:(id)data
{
    _cellModel = data;
    [self.contentView setBackgroundColor:[ARViewHepler getNavColor:_cellModel.parentVCType]];
    if (_cellModel.parentVCType == AR_BORROW_ING||_cellModel.parentVCType == 0||_cellModel.parentVCType == 11||_cellModel.parentVCType == 12) {
        self.statuLabel.text = [NSString stringWithFormat:@"%.f%%",[[NSString stringWithFormat:@"%@",[_cellModel.data investrate]] floatValue]*100];
        if ([_cellModel.cellBaseType integerValue]==0) {
            self.statuLabel.hidden = YES;
            self.hiddenView.hidden = NO;
            self.hiddenmoneyLabel.text = [NSString stringWithFormat:@"%@",[_cellModel.data objectForKey:@"investamount"]];
        }
        
    }else{
        switch (_cellModel.parentVCType) {
            case AR_FULL:case 700:
            {
                self.statuImage.image = [UIImage imageNamed:@"manbiao"];
                self.statuLabel.text = @"满标";
            }
                break;
            case AR_FAIL:case 6:
            {
                self.statuImage.image = [UIImage imageNamed:@"liubiao"];
                self.statuLabel.text = @"流标";
                if ([_cellModel.cellBaseType integerValue]==2) {
                    self.statuLabel.text = @"已流标";
                }
            }
                break;
            case AR_REFUND_ING:case 3:case 9:case 13:
            {
                self.statuImage.image = [UIImage imageNamed:@"huankuaning"];
                self.statuLabel.text = @"还款中";
            }
                break;
            case AR_ED:case 10:
            {
                self.statuImage.image = [UIImage imageNamed:@"yihuan"];
                self.statuLabel.text = @"已还";
            }
                break;
            case AR_OUT_DATE:
            {
                self.statuImage.image = [UIImage imageNamed:@"yuqi"];
                self.statuLabel.text = @"已逾期";
            }
                break;
                
            default:
                
                break;
        }
    }
    self.moneyLabel.text = [_cellModel.data hopeamount];
    self.lixiLabel.text = [_cellModel.data hoperate];
    if ([[_cellModel.data priod] integerValue]==0) {
        self.dateLabel.text = [NSString stringWithFormat:@"%@天",[_cellModel.data days]];
    }else{
        self.dateLabel.text = [NSString stringWithFormat:@"%@个月",[_cellModel.data priod]];
    }
}
- (void)reSet
{
    
}
- (id)getData
{
    return _cellModel;
}
- (void)setDelegate:(id)delegate
{
    
}

@end
